import React, { Component, useState, forwardRef, useContext } from 'react'
import myContext from '../context'
function Tow(props) {
    let a = useContext(myContext)
    let [isDispaly, setisDispaly] = useState(true)
    function TowIsShow() {
        setisDispaly(!isDispaly)
    }
    return (
        <div>
            <h1>tow:{props.num}</h1>
            <h1>context传值:{a}</h1>
            {isDispaly && <div style={{
                width: "100px",
                height: "100px",
                backgroundColor: "red"
            }}></div>}
        </div>
    )
}

export default Tow
